<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>查询收藏记录</title>
</head>

<body>
    <c:if test="${not empty message}">
        <div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
    </c:if>

    <table id="contentTable" class="table table-striped table-bordered table-condensed">
        <thead><tr><th width="40%">职位名称</th><th width="40%">公司名称</th><th width="20%">收藏日期</th></tr></thead>
        <tbody>
        <c:forEach items="${bookmarks.content}" var="bookmark">
            <tr>
            <c:if test="${bookmark.type == 1}">
                <td><a href="${ctx}/jobsearch/position/${bookmark.position.id}">${bookmark.position.name}</a></td>
                <td><a href="${ctx}/jobsearch/company/${bookmark.position.company.id}">${bookmark.position.company.name}</a></td>
            </c:if>
            <c:if test="${bookmark.type == 2}">
                <td></td>
                <td><a href="${ctx}/jobsearch/company/${bookmark.company.id}">${bookmark.company.name}</a></td>
            </c:if>
                <td><fmt:formatDate value="${bookmark.createDate}" pattern="yyyy-MM-dd" /></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>

    <tags:pagination page="${bookmarks}" paginationSize="20"/>

    <div><a class="btn" href="javascript:history.back()">返回</a></div>
</body>
</html>
